#!/usr/bin/perl -ws
#print "p=$p\n";
$ic = 1;
#$repl ="if (traceEnabled) { logUtil.trace(\"here $p \$ic\");}";
#$repl ="if (finerLoggable) { logger.finer(\"here $p \$ic\");}";
$repl ="System.out.println(\"here $p \$ic\");";
while (defined ($line = <>)) {
    #print "line=$line\n";
	if (($line =~ /return/) || ($line =~ /for/) || ($line =~ /break/) ||
			($line =~ /continue/) || ($line =~ /\(traceEnabled\)/) ||
			($line =~ /abstract/) || 
			($line =~ /throw/)) {
		print $line;
		next;
	}
	if ($line =~ /\r/) {
		eval "\$line =~ s/;([ \r])*\$/; $repl\$1/";
		eval "\$line =~ s/;}([ \r])*\$/;} $repl\$1/";
	} else {
		eval "\$line =~ s/; *\$/; $repl/";
		eval "\$line =~ s/;} *\$/;} $repl/";
	}
	$ic++;
	print $line;
}

